import React from 'react';
import { Route, Redirect } from 'react-router-dom';


function PrivateRoute({
    component: Component,
    isAuthenticated = false,
}) {
    return (
        <Route render={_props => isAuthenticated ? <Component {..._props} /> : <Redirect to={{ pathname: 'auth/login', state: { from: _props.location } }} />} />
    )
}
export default PrivateRoute